import request from '@/utils/request'

// 查询流程定义明细列表
export function listBpmninfo(query) {
  return request({
    url: '/workflow/bpmnInfo/list',
    method: 'get',
    params: query
  })
}

// 查询流程定义明细详细
export function getBpmninfo(id) {
  return request({
    url: '/workflow/bpmnInfo/' + id,
    method: 'get'
  })
}

// 新增流程定义明细
export function addBpmninfo(data) {
  return request({
    url: '/workflow/bpmnInfo',
    method: 'post',
    data: data
  })
}

// 修改流程定义明细
export function updateBpmninfo(data) {
  return request({
    url: '/workflow/bpmnInfo',
    method: 'put',
    data: data
  })
}

// 删除流程定义明细
export function delBpmninfo(id) {
  return request({
    url: '/workflow/bpmnInfo/' + id,
    method: 'delete'
  })
}

// 删除流程定义明细
export function getResouces(id,type) {
  return request({
    url: '/workflow/bpmnInfo/resouces/' + id,
    method: 'get',
    params:{type}
  })
}

// 上传流程定义
export function deploy(formData) {
  return request({
    url: '/workflow/bpmnInfo/deploy' ,
    data: formData,
    head:{
      'Content-Type': 'multipart/form-data'
    },
    method: 'post'
  })
}
